import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import API from '@/api'
import ButtonAgain from '@/components/ButtonAgain.vue'
import DrawPieImage from "./components/DrawPieImage.vue"


Vue.use(ElementUI)
Vue.config.productionTip=false;
//组件中基于this.$API访问接口请求的方法
Vue.prototype.$API=API;
//全局混入的方法
Vue.mixin({
    methods:{
        mixinPrefixAdd(url,prefix='https://iot.fastbee.cn/prod-api'){
            let reg=/^http(s)?:\/\//
            return reg.test(url)?url:prefix+url
        }
    }
})

// 注册全局组件
Vue.component(ButtonAgain.name,ButtonAgain);
Vue.component(DrawPieImage.name,DrawPieImage)
